The present invention relates to a picture coding device and a picture coding method, a picture transmitting device and a picture transmitting method, and a recording medium, and particularly to a picture coding device and a picture coding method, a picture transmitting device and a picture transmitting method, and a recording medium which can prevent deterioration of picture quality of decoded pictures.
TM5 (Test Model 5 (Test Mode 1 Editing Committee: “Test Model 5”, ISO/IEC JTC/SC29/WG11/NO400 (April 1993))) has been known as one of algorithms to gain a decoded picture with high picture quality, for example, in such a case that a picture is compressed and coded according to MPEG (Moving Picture Experts Group) system or the like. TM5 comprises three steps, and the following processing is performed in each step.
[Step 1]
A target code amount of a frame to be currently encoded is set on the basis of the complexity of the same type of frame which was previously encoded.
[Step 2]
A data storage amount of a virtual buffer to manage the difference between the target amount and the occurrence code amount every picture type is fed back, and on the basis of the data accumulation amount thereof a temporary quantizing index is set for a macroblock to be next encoded so that the actual occurrence code amount is coincident (substantially coincident) with the target code amount which is set in step 1.
[Step 3]
The quantizing index is finally determined on the basis of the complexity of a macroblock which is an encode target so that a visual characteristic, that is, the picture quality of the decoded picture is enhanced.
Accordingly, in the case of TM5, if something corresponding to the activity of a picture is used as a variable P which varies in accordance with the complexity of the picture and something corresponding to the temporary quantizing step which is determined from the data accumulation amount of the virtual buffer is used as a variable Q to make the occurrence coded amount coincident with the target code amount, the final quantizing index MQUANT for quantizing the macroblock is determined according to the following equation.MQUANT=f(P, Q)wherein f (P, Q) is a function of normalizing the values corresponding to the arguments P, Q to values within a predetermined range and outputting the normalized values.
As described above, in the TM5, the quantizing index is determined by the variable P corresponding to the complexity of the picture and the variable Q for making the occurrence code amount coincident with the target code amount, and the quantization is performed with the quantizing step corresponding to the quantizing index.
Therefore, when the occurrence code amount is not coincident with the target code amount although the complexity of macroblocks constituting the picture of a frame is identical, the quantizing step may be changed, resulting in deterioration of the picture quality of the decoded picture.
That is, when the complexity of the macroblocks constituting one frame is identical, it is preferable that all the macroblocks are quantized with the same quantizing step. In this case, if a macroblock is quantized with a quantizing step different from that of the surrounding macroblocks, the portion of the macroblock which is quantized while the quantizing step is varied becomes remarkable in the decoded picture.
Such a so-called block-type noise appears more remarkably when the quantizing step is varied in a small value range. That is, when the quantizing step is varied in the range between 7 and 8 which are relatively large values, the variation rate is equal to about 1/7 and 1/8. On the other hand, when the quantizing step is varied in the range between 3 and 4 which are small values, the variation rate is equal to 1/3 and 1/4 which are large values. Accordingly, when a quantizing step which is used for the quantization of macroblocks having the same complexity is varied in a small range, there appears remarkably the difference in picture quality between a macroblock quantized with a large quantizing step and a macroblock quantized with a small quantizing step.
Further, when a picture is subjected to MPEG coding, DCT coefficients are weighted (gradient) with a quantizing matrix in the quantization process from the viewpoint that high-order DCT coefficients are not important. That is, the high-order DCT coefficients are quantized with a larger quantization value than low-order DCT coefficients. Accordingly, with respect to the high-order DCT coefficients which are quantized with a larger quantizing value than the low-order DCT coefficients, even when the quantizing step is varied not in a small value range, but in a relatively large value range, one-step variation of the quantizing step has a large effect on the quantization value used for the quantization, resulting in deterioration of picture quality.
In view of the foregoing, there is a method of coding (encoding) a picture while fixing the quantizing step. However, in this method, when complicated pictures are sequential, the occurrence code amount is extremely increased, and a VBV (Video Buffering Verifier) buffer suffers underflow.